﻿Imports System.Windows.Media.Animation
Partial Public Class frmProgressBar
    Dim ProgressReport As ProgressBar

    Public WriteOnly Property TextToDisplay() As String
        Set(ByVal value As String)
            Me.TxtBlockDisplay.Text = value
        End Set
    End Property

    Private Sub frmProgressBar_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
        GeneralTasks.ChangeTheme(Me)
        'GeneralTasks.EnumerateandFill(Me.LogicalChildren)
        'Me.ShowProgressBar()
        'pictureBoxLoading.ImageLocation = Environment.CurrentDirectory.Replace("\bin\Debug", "") + "\Images\Progress1.gif"
    End Sub

    Private Sub ShowProgressBar()
        ProgressReport = New ProgressBar()
        Me.ProgressReport.Width = 200
        Me.ProgressReport.Height = 40
        Dim duration As New Duration(TimeSpan.FromSeconds(2000))
        Dim doubleanimation As New DoubleAnimation(100.0, duration)
        'doubleanimation.RepeatBehavior = RepeatBehavior.Forever
        doubleanimation.RepeatBehavior = New RepeatBehavior(5)
        Me.ProgressReport.BeginAnimation(ProgressBar.ValueProperty, doubleanimation)
        'doubleanimation.RepeatBehavior = new RepeatBehavior(5);
        'progbar.BeginAnimation(ProgressBar.ValueProperty, doubleanimation)
        'Me.ProgressReport.IsIndeterminate = True
        'Me.ProgressReport.Visibility = Windows.Visibility.Visible
        'Me.Content = ProgressReport
        'Me.LblMessage.Content = "Report is being generated ! "
        'Me.sbar.Items.Add(ProgressReport)
    End Sub

End Class
